module speaker(speaker,beep,tellingtime,clk_1khz);
/*
 * speaker: 输出闹铃
 * beep: 闹钟响铃使能
 * tellingtime: 倒计时使能
 * clk_1khz: 闹铃声音频率
 * Author: xianwu Liang
 */
 	input clk_1khz;
	input tellingtime;
	input beep;
	output speaker; //输出一个频率
	
	wire speaker1;
	wire speaker2;
	
	assign speaker1 = tellingtime?clk_1khz:0;
	assign speaker2 = beep?clk_1khz:0;
	assign speaker = speaker1 || speaker2;
	
 endmodule
 